export default function range(start, end, step) {
    if (typeof start === undefined && typeof end === undefined) return [];
    if (step === 0) step = 1;
    if (step === undefined) {
        step = end > start ? 1 : -1;
    }

    const result = [];
    if (step > 0) {
        for (let i = start; i < end; i += step) {
            result.push(i);
        }
    } else if (step < 0) {
        for (let i = start; i > end; i += step) {
            result.push(i);
        }
    }

    return result;
}